package com.cwj.mapper;


import com.cwj.model.Person;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface PersonMapper {

    @Insert("insert into person values(#{id},#{name},#{address},#{age},#{date},#{time})")
    void add(Person person);
    @Select("select * from person where id=#{id}")
    Person getById(@Param("id") Integer id);
    @Select("select * from person where date>#{date} and name=#{name}")
    List<Person> getPersonList(@Param("date") LocalDate date, @Param("name") String name);
}
